#include <iostream>
#include <unordered_map>

using namespace std;
#define int long long
int m , n;
unordered_map<int , int >mp;
signed main()
{
    cin >> m;
    n = (m + 1) / 2;
    int sum = 0;
    mp[0] = 0;
    for(int i = 1;i <= n;i ++)
    {
        sum += i;
        if(mp.count(sum - m)) cout << mp[sum - m] + 1 << " " << i << endl;
        mp[sum] = i;
    }
    return 0;
}